{extend name="base" /}
{block name="main"}

<div class="fly-panel fly-panel-user">
    <div class="tpt—admin">

        <fieldset class="layui-elem-field layui-field-title">
            <legend>管理修改</legend>
        </fieldset>

        <form class="layui-form">
            <input type="hidden" name="adminid" value="1">

            <div class="layui-form-item">
                <label class="layui-form-label">账号修改</label>
                <div class="layui-input-block">
                    <input type="text" name="adminname" value="{$tptc.adminname}" placeholder="请输入内容" autocomplete="off"
                           class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">口令修改</label>
                <div class="layui-input-block">
                    <input type="text" name="kouling" value="{$tptc.kouling}" placeholder="请输入内容" autocomplete="off"
                           class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">登录验证</label>
                <div class="layui-input-block">
                    <input type="text" name="validate" value="{$tptc.validate}" placeholder="请输入内容" autocomplete="off"
                           class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="admin_edits">立即提交</button>
                    <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
                </div>
            </div>
        </form>

    </div>
</div>
<script>
    layui.use(['form', 'element'], function () {
        var form = layui.form,
            element = layui.element,
            jq = layui.jquery;

        //提交
        form.on('submit(admin_edits)', function (data) {
            loading = layer.load(2, {
                shade: [0.2, '#000']
            });
            var param = data.field;
            jq.post('{:url("admin/edits")}', param, function (data) {
                if (data.code == 200) {
                    layer.close(loading);
                    layer.msg(data.msg, {icon: 1, time: 1000}, function () {
                        location.href = '{:url("admin/index")}';
                    });
                } else {
                    layer.close(loading);
                    layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
                }
            });
            return false;
        });

    })
</script>
{/block}